package COMP;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JPanel;

public class DrawDottedLine extends JPanel{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	int xInit;
	int yInit;
	int xEnd;
	int yEnd;
	DrawDottedLine(int xInit, int yInit, int xEnd, int yEnd){
		this.xInit = xInit;
		this.yInit = yInit;
		this.xEnd = xEnd;
		this.yEnd = yEnd;
		this.setSize(550,400);
		this.setOpaque(false);
	}
	public void paint(Graphics g){
		Graphics2D g2d = (Graphics2D)g.create();
		float[] dash=new float[]{5,5,5,5};
	    g2d.setStroke(new BasicStroke(3,0,BasicStroke.JOIN_MITER,1.0f,dash, 0));
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setColor(new Color(242,142,56));
		g2d.drawLine(xInit, yInit, xEnd, yEnd);
	}
}
